load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "snap_split",
    srcs = ["split.go"],
    importpath = "github.com/pingcap/tidb/br/pkg/restore/internal/snap_split",
    visibility = ["//br/pkg/restore:__subpackages__"],
    deps = [
        "//br/pkg/restore/split",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_log//:log",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "snap_split_test",
    timeout = "short",
    srcs = ["split_test.go"],
    flaky = True,
    shard_count = 4,
    deps = [
        ":snap_split",
        "//br/pkg/restore/split",
        "//br/pkg/restore/utils",
        "//br/pkg/rtree",
        "//pkg/util/codec",
        "@com_github_pingcap_kvproto//pkg/import_sstpb",
        "@com_github_stretchr_testify//require",
    ],
)
